<?php
ini_set('display_errors', 'on');
@session_start();
if (!isset($_SESSION['user'])) {
	header( 'Location: ./login.php');
	exit();
}

$user = $_SESSION['user'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<link rel="icon" href="./img/favicon.ico" type="image/x-icon" />
		<link rel="shortcut icon" href="./img/favicon.ico" type="image/x-icon" />
		<title>Account settings</title>

		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>

		<link rel="stylesheet" type="text/css" media="screen" href="./css/main.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="./css/settings.css" />
		<link rel="stylesheet" type="text/css" media="screen" href="./jquery-ui-1.8.16.custom.css" />
		<script>
			var session_user_info = <?php echo json_encode($user) ?>;
			if( session_user_info['avatar'] == 0 ) {
				session_user_info['avatar'] = "./img/noavatar_small.gif";
			}
		</script>
		<script src="./js/common.js" type="text/javascript"></script>
		<script src="./js/settings.js" type="text/javascript"></script>
		<script type="text/javascript">	
			var settings_type = "password";
			$(function() {
				render_nav( "#nav_password" );
			});
		</script>
	</head>
	<body>
        <div id="topBar">
        </div>

		<div id="settings-container" class="rounded" >
			<div id="settings-main" class="rounded">
				<div id="settings-main-inner" class="rounded">
					<div id="page-header" class="rounded"></div>
					<div id="settings-main-content">
						<div id="settings-main-content-inner">
							<h2 style="margin-top: 60px;">
								Change your password
							</h2>
							<table>
								<tr><td class="label">Your old password</td><td class="input"><div style="position: relative;"><input type="password" id="old-password"/></div></td> <td class="info"></td></tr>
								<tr></tr>
								<tr><td class="label">New password</td><td class="input"><div style="position: relative;"><input type="password" id="new-password"/></div></td> <td class="info"></td></tr>
								<tr><td class="label">Type password again</td><td class="input"><div style="position: relative;"><input type="password" id="new-password-again"/></div></td> <td class="info"></td></tr>
								<tr><td class="label"></td><td class="save"><div id="settings-save" class="shadowN rounded">Save</div></td> <td class="info"></td></tr>
							</table>
						</div>
					</div>
				</div>
			</div>
			<div id="settings-nav">
			</div>
		</div>
	</body>
</html>